package com.ruoyi.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.domain.BsQiyeMerchandise;
import com.ruoyi.system.domain.dto.BsCountNumDTO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 文创数据商品 Mapper接口
 */
public interface BsQiyeMerchandiseMapper extends BaseMapper<BsQiyeMerchandise> {

    @Select("select qiye_id aimId, count(id) countNum \n" +
            "from bs_qiye_merchandise \n" +
            "where  qiye_id in (${idsString}) and del_flag = '0' \n" +
            "group by qiye_id ")
    List<BsCountNumDTO> countMerchandise(@Param("idsString") String idsString);
}
